package top.forgirl.result;

import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

@Getter
@Setter
@ToString
public class Result<T> {

    private Integer code;
    private String msg;
    private T data;

    public Result(T data) {
        this(ResultEnum.SUCCESS, data);
    }

    public Result(ResultEnum resultEnum, T data) {
        this.code = resultEnum.getCode();
        this.msg = resultEnum.getMsg();
        this.data = data;
    }

    public Result() {
    }
}
